package ui.panels;

import entities.User;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EtchedBorder;
import ui.windows.RemedySchedulerFrame;

public class AdminBusiPanel extends javax.swing.JPanel {

    /** Creates new form AdminBusiPanel */
    public AdminBusiPanel(RemedySchedulerFrame mainFrame) {
        initComponents();
        this.mainFrame = mainFrame;
        includeModel();
    }

    private void includeModel() {
        User user = mainFrame.getUser();
        lbDep.setText(user.getDepartmentName());
        if (user.getTitle() != null && user.getTitle().length() != 0) {
            lbName.setText(user.getTitle());
        } else {
            lbName.setText(user.getLoginID());
        }

        new Thread() {

            @Override
            public void run() {
                while (true) {
                    SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd h:mm a");
                    lbTime.setText(dateFormat.format(Calendar.getInstance().getTime()));
                    try {
                        sleep(1000);
                    } catch (InterruptedException ex) {
                        ex.printStackTrace();
                    }
                }
            }
        }.start();

        introductionPanel = new IntroductionPanel();
        editPatientPanel = new PatientManagementPanel(mainFrame);
        pMaterialPanel = new PMaterialManagementPanel(mainFrame);
        viewDSchedulerPanel = new ViewDoctorSchedulerPanel(mainFrame);
        schedulerPanel = new SchedulerPanel(mainFrame);
        shiftRequestPanel = new EditShiftRequestPanel(mainFrame);
        viewHolidayPanel = new ViewHolidayPanel(mainFrame);
        viewProfilePanel = new ViewProfilePanel(user);
        editProfilePanel = new EditProfilePanel(mainFrame);
        changePassAPanel = new ChangePassPanel(mainFrame);
        showStartPage();
        timePanel = new TimePanel(mainFrame);
        timePanel.setBorder(new EtchedBorder());
        
        expandMenu1 = true;
        expandMenu2 = true;
        expandMenu3 = true;
        expandMenu4 = true;
    }

    private void switchTarget(int choise) {
        if (target != choise) {
            switch (target) {
                case 0:
                    break;
                case 1:
                    lbStartPageM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 2:
                    lbPManagementM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 3:
                    lbCreatePM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 4:
                    lbPMaterialM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 5:
                    lbViewDSchedulerM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 6:
                    lbScheduler.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 7:
                    lbShiftRequestM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 8:
                    lbHolidayM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 9:
                    lbViewPM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 10:
                    lbEditPM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 11:
                    lbChangePassM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 12:
                    lbHelpM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
            }
            target = choise;
            this.remove(viewControl);
            this.repaint();
            switch (choise) {
                case 0:
                    viewControl = new JScrollPane(introductionPanel);
                    break;
                case 1:
                    viewControl = new JScrollPane(startPage);
                    lbStartPageM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 2:
                    editPatientPanel.showAllPatient();
                    viewControl = new JScrollPane(editPatientPanel);
                    lbPManagementM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 3:
                    editPatientPanel.showCreatePatient();
                    viewControl = new JScrollPane(editPatientPanel);
                    lbCreatePM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 4:
                    viewControl = new JScrollPane(pMaterialPanel);
                    lbPMaterialM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 5:
                    viewControl = new JScrollPane(viewDSchedulerPanel);
                    lbViewDSchedulerM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 6:
                    viewControl = new JScrollPane(schedulerPanel);
                    lbScheduler.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 7:
                    viewControl = new JScrollPane(shiftRequestPanel);
                    lbShiftRequestM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 8:
                    viewControl = new JScrollPane(viewHolidayPanel);
                    lbHolidayM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 9:
                    viewControl = new JScrollPane(viewProfilePanel);
                    lbViewPM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 10:
                    viewControl = new JScrollPane(editProfilePanel);
                    lbEditPM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 11:
                    viewControl = new JScrollPane(changePassAPanel);
                    lbChangePassM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 12:
                    viewControl = new JScrollPane();
                    lbHelpM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
            }
            this.add(viewControl, BorderLayout.CENTER);
            this.revalidate();
        }
    }

    private void showIntroduction() {
        switchTarget(0);
    }

    private void showStartPage() {
        switchTarget(1);
    }

    private void showPatientMaterial() {
        switchTarget(2);
    }

    private void showCreatePatient() {
        switchTarget(3);
    }

    private void showInputMaterial() {
        switchTarget(4);
    }

    private void showViewDScheduler() {
        switchTarget(5);
    }
    
    private void showScheduler() {
        switchTarget(6);
    }

    private void showShiftRequest() {
        switchTarget(7);
    }

    private void showHoliday() {
        switchTarget(8);
    }

    private void showViewP() {
        switchTarget(9);
    }

    private void showEditP() {
        switchTarget(10);
    }

    private void showChangePass() {
        switchTarget(11);
    }

    private void showHelp() {
        switchTarget(12);
    }

    private void showHireControler() {
        if (showControler) {
            this.remove(controler);
            lbOpenControler.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand2_15.gif")));
            showControler = false;
        } else {
            this.add(controler, BorderLayout.WEST);
            lbOpenControler.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand1_15.gif")));
            showControler = true;
        }
        this.revalidate();
    }

    private void showHireTimer() {
        if (!showTimer) {
            this.add(timePanel, BorderLayout.EAST);
            lbOpenTimer.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand2_15.gif")));
            showTimer = true;
        } else {
            this.remove(timePanel);
            lbOpenTimer.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand1_15.gif")));
            showTimer = false;
        }
        this.revalidate();
    }
    
    private void expandMenu1() {
        if(expandMenu1) {
            new Thread() {
                @Override
                public void run() {
                    menu1.remove(lbPMaterialM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbCreatePM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbPManagementM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbStartPageM);
                    menu1.repaint();
                    controler.revalidate();
                    lbPManagementTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(AdminBusiPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu1 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu1.add(lbStartPageM);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbPManagementM);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbCreatePM);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbPMaterialM);
                    menu1.revalidate();
                    controler.revalidate();
                    lbPManagementTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu1 = true;
        }
    }
    
    private void expandMenu2() {
        if(expandMenu2) {
            new Thread() {
                @Override
                public void run() {
                    menu2.remove(lbViewDSchedulerM);
                    menu2.repaint();
                    controler.revalidate();
                    lbViewDSchedulerTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(AdminBusiPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu2 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu2.add(lbViewDSchedulerM);
                    menu2.revalidate();
                    controler.revalidate();
                    lbViewDSchedulerTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu2 = true;
        }
    }
    
    private void expandMenu3() {
        if(expandMenu3) {
            new Thread() {
                @Override
                public void run() {
                    menu3.remove(lbHolidayM);
                    menu3.repaint();
                    sleepTime(25);
                    menu3.remove(lbShiftRequestM);
                    menu3.repaint();
                    sleepTime(25);
                    menu3.remove(lbScheduler);
                    menu3.repaint();
                    controler.revalidate();
                    lbNoticeTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(AdminBusiPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu3 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu3.add(lbScheduler);
                    menu3.revalidate();
                    sleepTime(25);
                    menu3.add(lbShiftRequestM);
                    menu3.revalidate();
                    sleepTime(25);
                    menu3.add(lbHolidayM);
                    menu3.revalidate();
                    controler.revalidate();
                    lbNoticeTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu3 = true;
        }
    }
    
    private void expandMenu4() {
        if(expandMenu4) {
            new Thread() {
                @Override
                public void run() {
                    menu4.remove(lbHelpM);
                    menu4.repaint();
                    sleepTime(25);
                    menu4.remove(lbChangePassM);
                    menu4.repaint();
                    sleepTime(25);
                    menu4.remove(lbEditPM);
                    menu4.repaint();
                    sleepTime(25);
                    menu4.remove(lbViewPM);
                    menu4.repaint();
                    controler.revalidate();
                    lbOperationTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(AdminBusiPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu4 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu4.add(lbViewPM);
                    menu4.revalidate();
                    sleepTime(25);
                    menu4.add(lbEditPM);
                    menu4.revalidate();
                    sleepTime(25);
                    menu4.add(lbChangePassM);
                    menu4.revalidate();
                    sleepTime(25);
                    menu4.add(lbHelpM);
                    menu4.revalidate();
                    controler.revalidate();
                    lbOperationTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu4 = true;
        }
    }
    
    private void logout() {
        boolean logout = mainFrame.logout();
        if (!logout) {
            JOptionPane.showMessageDialog(null, "Cannot logout", "Error", JOptionPane.WARNING_MESSAGE);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        lbHeader = new javax.swing.JLabel();
        lbDep = new javax.swing.JLabel();
        lbTime = new javax.swing.JLabel();
        lbLogout = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lbEditP = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lbName = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        lbOpenControler = new javax.swing.JLabel();
        lbOpenTimer = new javax.swing.JLabel();
        controler = new javax.swing.JScrollPane();
        jPanel3 = new javax.swing.JPanel();
        lbPManagementTab = new javax.swing.JLabel();
        menu1 = new javax.swing.JPanel();
        lbStartPageM = new javax.swing.JLabel();
        lbPManagementM = new javax.swing.JLabel();
        lbCreatePM = new javax.swing.JLabel();
        lbPMaterialM = new javax.swing.JLabel();
        lbNoticeTab = new javax.swing.JLabel();
        lbOperationTab = new javax.swing.JLabel();
        menu4 = new javax.swing.JPanel();
        lbViewPM = new javax.swing.JLabel();
        lbEditPM = new javax.swing.JLabel();
        lbChangePassM = new javax.swing.JLabel();
        lbHelpM = new javax.swing.JLabel();
        lbViewDSchedulerTab = new javax.swing.JLabel();
        menu2 = new javax.swing.JPanel();
        lbViewDSchedulerM = new javax.swing.JLabel();
        menu3 = new javax.swing.JPanel();
        lbScheduler = new javax.swing.JLabel();
        lbShiftRequestM = new javax.swing.JLabel();
        lbHolidayM = new javax.swing.JLabel();
        viewControl = new javax.swing.JScrollPane();
        startPage = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();

        setLayout(new java.awt.BorderLayout());

        jPanel1.setBackground(new java.awt.Color(102, 0, 0));

        lbHeader.setFont(new java.awt.Font("Agency FB", 1, 24));
        lbHeader.setForeground(new java.awt.Color(255, 255, 51));
        lbHeader.setText("Remedy Scheduler");

        lbDep.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbDep.setForeground(new java.awt.Color(255, 255, 51));
        lbDep.setText("Department");

        lbTime.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbTime.setForeground(new java.awt.Color(204, 255, 204));
        lbTime.setText("Time");

        lbLogout.setForeground(new java.awt.Color(204, 255, 204));
        lbLogout.setText("Logout");
        lbLogout.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbLogoutMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbLogoutMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbLogoutMouseExited(evt);
            }
        });

        jLabel5.setForeground(new java.awt.Color(204, 255, 204));
        jLabel5.setText("|");

        lbEditP.setForeground(new java.awt.Color(204, 255, 204));
        lbEditP.setText("Edit Profile");
        lbEditP.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEditPMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEditPMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEditPMouseExited(evt);
            }
        });

        jLabel7.setForeground(new java.awt.Color(204, 255, 204));
        jLabel7.setText("Hi");

        lbName.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbName.setForeground(new java.awt.Color(204, 255, 204));
        lbName.setText("Name");
        lbName.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbNameMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbNameMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbNameMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(lbDep)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 334, Short.MAX_VALUE)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbName)
                        .addGap(125, 125, 125)
                        .addComponent(lbEditP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbLogout))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lbHeader)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 518, Short.MAX_VALUE)
                        .addComponent(lbTime)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbTime)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lbHeader)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbDep)
                            .addComponent(lbLogout)
                            .addComponent(jLabel5)
                            .addComponent(lbEditP)
                            .addComponent(jLabel7)
                            .addComponent(lbName))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        add(jPanel1, java.awt.BorderLayout.PAGE_START);

        lbOpenControler.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/expand1_15.gif"))); // NOI18N
        lbOpenControler.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOpenControlerMouseClicked(evt);
            }
        });

        lbOpenTimer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/expand1_15.gif"))); // NOI18N
        lbOpenTimer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOpenTimerMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbOpenControler)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 658, Short.MAX_VALUE)
                .addComponent(lbOpenTimer)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(lbOpenControler)
                .addComponent(lbOpenTimer))
        );

        add(jPanel2, java.awt.BorderLayout.PAGE_END);

        jPanel3.setBackground(new java.awt.Color(153, 255, 255));

        lbPManagementTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbPManagementTab.setForeground(new java.awt.Color(102, 102, 102));
        lbPManagementTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbPManagementTab.setText("Patient management");
        lbPManagementTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbPManagementTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbPManagementTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbPManagementTabMouseExited(evt);
            }
        });

        menu1.setBackground(new java.awt.Color(153, 255, 255));
        menu1.setLayout(new java.awt.GridLayout(0, 1));

        lbStartPageM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbStartPageM.setText("Start page");
        lbStartPageM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbStartPageM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbStartPageMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbStartPageMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbStartPageMMouseExited(evt);
            }
        });
        menu1.add(lbStartPageM);

        lbPManagementM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbPManagementM.setText("Patient management");
        lbPManagementM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbPManagementM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbPManagementMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbPManagementMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbPManagementMMouseExited(evt);
            }
        });
        menu1.add(lbPManagementM);

        lbCreatePM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbCreatePM.setText("Create new patient");
        lbCreatePM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbCreatePM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbCreatePMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbCreatePMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbCreatePMMouseExited(evt);
            }
        });
        menu1.add(lbCreatePM);

        lbPMaterialM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbPMaterialM.setText("Patient's Material");
        lbPMaterialM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbPMaterialM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbPMaterialMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbPMaterialMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbPMaterialMMouseExited(evt);
            }
        });
        menu1.add(lbPMaterialM);

        lbNoticeTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbNoticeTab.setForeground(new java.awt.Color(102, 102, 102));
        lbNoticeTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbNoticeTab.setText("Notice");
        lbNoticeTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbNoticeTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbNoticeTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbNoticeTabMouseExited(evt);
            }
        });

        lbOperationTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbOperationTab.setForeground(new java.awt.Color(102, 102, 102));
        lbOperationTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbOperationTab.setText("Operations");
        lbOperationTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseExited(evt);
            }
        });

        menu4.setBackground(new java.awt.Color(153, 255, 255));
        menu4.setLayout(new java.awt.GridLayout(0, 1));

        lbViewPM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbViewPM.setText("View profile");
        lbViewPM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbViewPM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbViewPMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbViewPMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbViewPMMouseExited(evt);
            }
        });
        menu4.add(lbViewPM);

        lbEditPM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbEditPM.setText("Edit profile");
        lbEditPM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbEditPM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEditPMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEditPMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEditPMMouseExited(evt);
            }
        });
        menu4.add(lbEditPM);

        lbChangePassM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbChangePassM.setText("Change password");
        lbChangePassM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbChangePassM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseExited(evt);
            }
        });
        menu4.add(lbChangePassM);

        lbHelpM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbHelpM.setText("Help");
        lbHelpM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbHelpM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbHelpMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbHelpMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbHelpMMouseExited(evt);
            }
        });
        menu4.add(lbHelpM);

        lbViewDSchedulerTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbViewDSchedulerTab.setForeground(new java.awt.Color(102, 102, 102));
        lbViewDSchedulerTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbViewDSchedulerTab.setText("View Doctor's Scheduler");
        lbViewDSchedulerTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbViewDSchedulerTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbViewDSchedulerTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbViewDSchedulerTabMouseExited(evt);
            }
        });

        menu2.setBackground(new java.awt.Color(153, 255, 255));
        menu2.setLayout(new java.awt.GridLayout(0, 1));

        lbViewDSchedulerM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbViewDSchedulerM.setText("View doctor's chager sheet");
        lbViewDSchedulerM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbViewDSchedulerM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbViewDSchedulerMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbViewDSchedulerMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbViewDSchedulerMMouseExited(evt);
            }
        });
        menu2.add(lbViewDSchedulerM);

        menu3.setBackground(new java.awt.Color(153, 255, 255));
        menu3.setLayout(new java.awt.GridLayout(0, 1));

        lbScheduler.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbScheduler.setText("Scheduler");
        lbScheduler.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbSchedulerMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbSchedulerMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbSchedulerMouseExited(evt);
            }
        });
        menu3.add(lbScheduler);

        lbShiftRequestM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbShiftRequestM.setText("Shift Request");
        lbShiftRequestM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbShiftRequestM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseExited(evt);
            }
        });
        menu3.add(lbShiftRequestM);

        lbHolidayM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbHolidayM.setText("Holiday");
        lbHolidayM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbHolidayM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseExited(evt);
            }
        });
        menu3.add(lbHolidayM);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbPManagementTab)
                .addContainerGap())
            .addComponent(menu1, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbViewDSchedulerTab)
                .addContainerGap())
            .addComponent(menu2, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbNoticeTab)
                .addContainerGap())
            .addComponent(menu3, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbOperationTab)
                .addContainerGap())
            .addComponent(menu4, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbPManagementTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbViewDSchedulerTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbNoticeTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbOperationTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(63, Short.MAX_VALUE))
        );

        controler.setViewportView(jPanel3);

        add(controler, java.awt.BorderLayout.LINE_START);

        startPage.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel1.setForeground(new java.awt.Color(102, 102, 102));
        jLabel1.setText("Operations:");

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/Inpatient-50.png"))); // NOI18N
        jButton1.setToolTipText("patient's material");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/patient-50.png"))); // NOI18N
        jButton2.setToolTipText("patient management");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/schedulerIcon.gif"))); // NOI18N
        jButton3.setToolTipText("view doctor's scheduler");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/schedule-50.png"))); // NOI18N
        jButton4.setToolTipText("scheduler");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/request.png"))); // NOI18N
        jButton5.setToolTipText("request");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/calendar-50.png"))); // NOI18N
        jButton6.setToolTipText("holiday");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout startPageLayout = new javax.swing.GroupLayout(startPage);
        startPage.setLayout(startPageLayout);
        startPageLayout.setHorizontalGroup(
            startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(startPageLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addGroup(startPageLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(startPageLayout.createSequentialGroup()
                                .addComponent(jButton3)
                                .addGap(18, 18, 18)
                                .addComponent(jButton4)
                                .addGap(18, 18, 18)
                                .addComponent(jButton5)
                                .addGap(18, 18, 18)
                                .addComponent(jButton6))
                            .addGroup(startPageLayout.createSequentialGroup()
                                .addComponent(jButton1)
                                .addGap(18, 18, 18)
                                .addComponent(jButton2)))))
                .addContainerGap(213, Short.MAX_VALUE))
        );
        startPageLayout.setVerticalGroup(
            startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(startPageLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton2)
                    .addComponent(jButton1))
                .addGap(48, 48, 48)
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton6)
                    .addComponent(jButton5)
                    .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(217, Short.MAX_VALUE))
        );

        viewControl.setViewportView(startPage);

        add(viewControl, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

private void lbNameMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseClicked
    showViewP();
}//GEN-LAST:event_lbNameMouseClicked

private void lbNameMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseEntered
    lbName.setForeground(Color.yellow);
}//GEN-LAST:event_lbNameMouseEntered

private void lbNameMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseExited
    lbName.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbNameMouseExited

private void lbEditPMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseClicked
    showEditP();
}//GEN-LAST:event_lbEditPMouseClicked

private void lbEditPMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseEntered
    lbEditPM.setForeground(Color.yellow);
}//GEN-LAST:event_lbEditPMouseEntered

private void lbEditPMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseExited
    lbEditPM.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbEditPMouseExited

private void lbLogoutMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseClicked
    logout();
}//GEN-LAST:event_lbLogoutMouseClicked

private void lbLogoutMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseEntered
    lbLogout.setForeground(Color.yellow);
}//GEN-LAST:event_lbLogoutMouseEntered

private void lbLogoutMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseExited
    lbLogout.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbLogoutMouseExited

private void lbPManagementTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPManagementTabMouseClicked
    expandMenu1();
}//GEN-LAST:event_lbPManagementTabMouseClicked

private void lbPManagementTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPManagementTabMouseEntered
    lbPManagementTab.setForeground(Color.blue);
}//GEN-LAST:event_lbPManagementTabMouseEntered

private void lbPManagementTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPManagementTabMouseExited
    lbPManagementTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbPManagementTabMouseExited

private void lbViewDSchedulerTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewDSchedulerTabMouseClicked
    expandMenu2();
}//GEN-LAST:event_lbViewDSchedulerTabMouseClicked

private void lbViewDSchedulerTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewDSchedulerTabMouseEntered
    lbViewDSchedulerTab.setForeground(Color.blue);
}//GEN-LAST:event_lbViewDSchedulerTabMouseEntered

private void lbViewDSchedulerTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewDSchedulerTabMouseExited
    lbViewDSchedulerTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbViewDSchedulerTabMouseExited

private void lbNoticeTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNoticeTabMouseClicked
    expandMenu3();
}//GEN-LAST:event_lbNoticeTabMouseClicked

private void lbNoticeTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNoticeTabMouseEntered
    lbNoticeTab.setForeground(Color.blue);
}//GEN-LAST:event_lbNoticeTabMouseEntered

private void lbNoticeTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNoticeTabMouseExited
    lbNoticeTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbNoticeTabMouseExited

private void lbOperationTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseClicked
    expandMenu4();
}//GEN-LAST:event_lbOperationTabMouseClicked

private void lbOperationTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseEntered
    lbOperationTab.setForeground(Color.blue);
}//GEN-LAST:event_lbOperationTabMouseEntered

private void lbOperationTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseExited
    lbOperationTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbOperationTabMouseExited

private void lbStartPageMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMMouseClicked
    showStartPage();
}//GEN-LAST:event_lbStartPageMMouseClicked

private void lbStartPageMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMMouseEntered
    lbStartPageM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbStartPageMMouseEntered

private void lbStartPageMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMMouseExited
    lbStartPageM.setBorder(null);
}//GEN-LAST:event_lbStartPageMMouseExited

private void lbPManagementMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPManagementMMouseClicked
    showPatientMaterial();
}//GEN-LAST:event_lbPManagementMMouseClicked

private void lbPManagementMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPManagementMMouseEntered
    lbPManagementM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbPManagementMMouseEntered

private void lbPManagementMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPManagementMMouseExited
    lbPManagementM.setBorder(null);
}//GEN-LAST:event_lbPManagementMMouseExited

private void lbCreatePMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreatePMMouseClicked
    showCreatePatient();
}//GEN-LAST:event_lbCreatePMMouseClicked

private void lbCreatePMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreatePMMouseEntered
    lbCreatePM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbCreatePMMouseEntered

private void lbCreatePMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreatePMMouseExited
    lbCreatePM.setBorder(null);
}//GEN-LAST:event_lbCreatePMMouseExited

private void lbPMaterialMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPMaterialMMouseClicked
    showInputMaterial();
}//GEN-LAST:event_lbPMaterialMMouseClicked

private void lbPMaterialMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPMaterialMMouseEntered
    lbPMaterialM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbPMaterialMMouseEntered

private void lbPMaterialMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPMaterialMMouseExited
    lbPMaterialM.setBorder(null);
}//GEN-LAST:event_lbPMaterialMMouseExited

private void lbViewDSchedulerMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewDSchedulerMMouseClicked
    showViewDScheduler();
}//GEN-LAST:event_lbViewDSchedulerMMouseClicked

private void lbViewDSchedulerMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewDSchedulerMMouseEntered
    lbViewDSchedulerM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbViewDSchedulerMMouseEntered

private void lbViewDSchedulerMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewDSchedulerMMouseExited
    lbViewDSchedulerM.setBorder(null);
}//GEN-LAST:event_lbViewDSchedulerMMouseExited

private void lbShiftRequestMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseClicked
    showShiftRequest();
}//GEN-LAST:event_lbShiftRequestMMouseClicked

private void lbShiftRequestMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseEntered
    lbShiftRequestM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbShiftRequestMMouseEntered

private void lbShiftRequestMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseExited
    lbShiftRequestM.setBorder(null);
}//GEN-LAST:event_lbShiftRequestMMouseExited

private void lbHolidayMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseClicked
    showHoliday();
}//GEN-LAST:event_lbHolidayMMouseClicked

private void lbHolidayMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseEntered
    lbHolidayM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbHolidayMMouseEntered

private void lbHolidayMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseExited
    lbHolidayM.setBorder(null);
}//GEN-LAST:event_lbHolidayMMouseExited

private void lbViewPMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseClicked
    showViewP();
}//GEN-LAST:event_lbViewPMMouseClicked

private void lbViewPMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseEntered
    lbViewPM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbViewPMMouseEntered

private void lbViewPMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseExited
    lbViewPM.setBorder(null);
}//GEN-LAST:event_lbViewPMMouseExited

private void lbEditPMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseClicked
    showEditP();
}//GEN-LAST:event_lbEditPMMouseClicked

private void lbEditPMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseEntered
    lbEditPM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbEditPMMouseEntered

private void lbEditPMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseExited
    lbEditPM.setBorder(null);
}//GEN-LAST:event_lbEditPMMouseExited

private void lbChangePassMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseClicked
    showChangePass();
}//GEN-LAST:event_lbChangePassMMouseClicked

private void lbChangePassMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseEntered
    lbChangePassM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbChangePassMMouseEntered

private void lbChangePassMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseExited
    lbChangePassM.setBorder(null);
}//GEN-LAST:event_lbChangePassMMouseExited

private void lbHelpMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseExited
    lbHelpM.setBorder(null);
}//GEN-LAST:event_lbHelpMMouseExited

private void lbHelpMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseEntered
    lbHelpM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbHelpMMouseEntered

private void lbHelpMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseClicked
    showHelp();
}//GEN-LAST:event_lbHelpMMouseClicked

private void lbOpenControlerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOpenControlerMouseClicked
    showHireControler();
}//GEN-LAST:event_lbOpenControlerMouseClicked

private void lbOpenTimerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOpenTimerMouseClicked
    showHireTimer();
}//GEN-LAST:event_lbOpenTimerMouseClicked

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    showInputMaterial();
}//GEN-LAST:event_jButton1ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    showPatientMaterial();
}//GEN-LAST:event_jButton2ActionPerformed

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
    showViewDScheduler();
}//GEN-LAST:event_jButton3ActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
    showScheduler();
}//GEN-LAST:event_jButton4ActionPerformed

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
    showShiftRequest();
}//GEN-LAST:event_jButton5ActionPerformed

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
    showHoliday();
}//GEN-LAST:event_jButton6ActionPerformed

private void lbSchedulerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerMouseClicked
    showScheduler();
}//GEN-LAST:event_lbSchedulerMouseClicked

private void lbSchedulerMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerMouseEntered
    lbScheduler.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbSchedulerMouseEntered

private void lbSchedulerMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerMouseExited
    lbScheduler.setBorder(null);
}//GEN-LAST:event_lbSchedulerMouseExited
    private RemedySchedulerFrame mainFrame;
    private IntroductionPanel introductionPanel;
    private PatientManagementPanel editPatientPanel;
    private PMaterialManagementPanel pMaterialPanel;
    private ViewDoctorSchedulerPanel viewDSchedulerPanel;
    private SchedulerPanel schedulerPanel;
    private EditShiftRequestPanel shiftRequestPanel;
    private ViewHolidayPanel viewHolidayPanel;
    private ViewProfilePanel viewProfilePanel;
    private EditProfilePanel editProfilePanel;
    private ChangePassPanel changePassAPanel;
    private JPanel currentPanel;
    private TimePanel timePanel;
    private boolean showControler = true;
    private boolean showTimer = false;
    private int target;
    private boolean expandMenu1, expandMenu2, expandMenu3, expandMenu4;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane controler;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JLabel lbChangePassM;
    private javax.swing.JLabel lbCreatePM;
    private javax.swing.JLabel lbDep;
    private javax.swing.JLabel lbEditP;
    private javax.swing.JLabel lbEditPM;
    private javax.swing.JLabel lbHeader;
    private javax.swing.JLabel lbHelpM;
    private javax.swing.JLabel lbHolidayM;
    private javax.swing.JLabel lbLogout;
    private javax.swing.JLabel lbName;
    private javax.swing.JLabel lbNoticeTab;
    private javax.swing.JLabel lbOpenControler;
    private javax.swing.JLabel lbOpenTimer;
    private javax.swing.JLabel lbOperationTab;
    private javax.swing.JLabel lbPManagementM;
    private javax.swing.JLabel lbPManagementTab;
    private javax.swing.JLabel lbPMaterialM;
    private javax.swing.JLabel lbScheduler;
    private javax.swing.JLabel lbShiftRequestM;
    private javax.swing.JLabel lbStartPageM;
    private javax.swing.JLabel lbTime;
    private javax.swing.JLabel lbViewDSchedulerM;
    private javax.swing.JLabel lbViewDSchedulerTab;
    private javax.swing.JLabel lbViewPM;
    private javax.swing.JPanel menu1;
    private javax.swing.JPanel menu2;
    private javax.swing.JPanel menu3;
    private javax.swing.JPanel menu4;
    private javax.swing.JPanel startPage;
    private javax.swing.JScrollPane viewControl;
    // End of variables declaration//GEN-END:variables
}
